class A {
  name: string;
  constructor(name: string) {
    this.name = name;
  }
}

class C {
  name: string;
  constructor(name: string) {
    this.name = name;
  }
}

class Model {
  model: any;
  constructor() {
    this.model = {};
  }

  provide(key: string, value: any) {
    this.model[key] = value;
  }

  get(key: string) {
    return this.model[key];
  }
}

const mo = new Model();

mo.provide("a", new A("邓子雄"));

mo.provide("c", new C("旋风小熊"));

class B {
  a: any;
  c: any;
  constructor() {
    this.a = mo.get("a");
    this.c = mo.get("c");
  }
}
